package o;

import android.app.Activity;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Handler;
import android.os.Looper;
import java.util.HashMap;

public class csq {
    private static Runnable ʽ = new Runnable() {
        public void run() {
            csq.ॱ();
        }
    };
    private static boolean ˊ = false;
    private static HashMap<String, String> ˋ = new HashMap();
    private static String ˎ;
    private static int ˏ = 10000;
    private static int ॱ = dgm.ˎ();
    private static Handler ॱॱ = new Handler(Looper.getMainLooper());

    public static void ˊ(String str, String str2) {
        if (ˋ != null && str != null) {
            ˋ.put(str, str2);
        }
    }

    public static String ˎ(String str) {
        if (ˋ == null || str == null || ˋ.get(str) == null) {
            return "0";
        }
        return (String) ˋ.get(str);
    }

    public static void ˊ() {
        if (ˋ != null) {
            ˋ.clear();
        }
    }

    public static void ˎ(Activity activity, boolean z) {
        if (z) {
            ॱ = 4;
        } else {
            ॱ = dgm.ˎ(activity);
        }
    }

    public static int ˋ() {
        return ॱ;
    }

    public static void ˏ() {
        try {
            ˎ = cro.ˏ().ˎ().getPackageManager().getPackageInfo("com.huawei.hwid", 0).versionName;
        } catch (NameNotFoundException e) {
            crf.ˎ.ˊ("ParameterUtils", "Package not found.");
        }
    }

    public static String ˎ() {
        if (ˎ == null) {
            ˏ();
        }
        return ˎ;
    }

    public static boolean ˊ(boolean z) {
        crf.ˎ.ˋ("ParameterUtils", "flowLockStatus = " + ˊ);
        if (ˊ) {
            if (!z) {
                ॱॱ.removeCallbacks(ʽ);
            }
            return false;
        }
        ˊ = true;
        if (z) {
            ʼ();
        }
        return ˊ;
    }

    public static void ॱ() {
        ˊ = false;
    }

    public static void ʼ() {
        ॱॱ.removeCallbacks(ʽ);
        ॱॱ.postDelayed(ʽ, (long) ˏ);
    }
}
